import { createRouter, createWebHashHistory } from "vue-router"
const routes = [
  {
    path: '/',
    redirect: '/login'
    
  },
  {
    path: '/login',
    component: () => import('../views/Login/index.vue')
  },
  {
    path: '/data-center',
    component: () => import('../views/Layout/layout.vue'),
    children: [
      {
        path: 'bid/list',
        component: () => import('../views/bidManage/index.vue')
      },
      {
        path: 'bid/add',
        component: () => import('../views/bidManage/add.vue')
      },
      {
        path: 'bid/edit',
        component: () => import('../views/bidManage/edit.vue')
      },
      {
        path: 'bid/detail',
        component: () => import('../views/bidManage/detail.vue')
      }
    ]
  },
  
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})



router.beforeEach((to, from, next) => {
  // const userInfo = JSON.parse(window.sessionStorage.getItem('userStore')).userInfo
  // console.log('userInfo', userInfo)
  // // 判断是否登录
  // if (!userInfo) {}
  next()
})


export default router